package com.aimaterials.resource.controller;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Test {
    public static void main(String[] args) {
// 注意：一定要使用创建对象的格式创建数组
        Long[] oldIds = new Long[]{6L, 3L, 9L, 3L, 2L, 4L, 5L, 7L};
        Long[] resourceIds = new Long[]{5L, 8L, 6L, 2L, 1L, 9L};
        List<Long> oldL = Arrays.asList(oldIds);
        List<Long> newL = Arrays.asList(resourceIds);

        // 创建集合
        Collection<Long> realOld = new ArrayList<Long>(oldL);
        Collection<Long> realNew = new ArrayList<Long>(newL);

        Collection<Long> tempNew = new ArrayList<Long>(newL);

        //查找出新增加的资源
        realNew.removeAll(realOld);

        realOld.removeAll(tempNew);


        System.out.println("realOld最终结果是："+realOld);

        System.out.println("realNew最终结果是："+realNew);

        System.out.println("tempNew最终结果是："+tempNew);

    }
}